

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>7.7. Fast QCP RMSD structure alignment — MDAnalysis.core.qcprot &mdash; MDAnalysis v0.7.5-devel documentation</title>
    <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '0.7.5-devel',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within MDAnalysis v0.7.5-devel documentation"
          href="../../_static/opensearch.xml"/>
    <link rel="shortcut icon" href="../../_static/mdanalysis-logo.ico"/>
    <link rel="top" title="MDAnalysis v0.7.5-devel documentation" href="../../index.html" />
    <link rel="up" title="7. Core modules" href="../core_modules.html" />
    <link rel="next" title="7.8. Constants and unit conversion — MDAnalysis.core.units" href="units.html" />
    <link rel="prev" title="7.6. Homogeneous Transformation Matrices and Quaternions — MDAnalysis.core.transformations" href="transformations.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="units.html" title="7.8. Constants and unit conversion — MDAnalysis.core.units"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="transformations.html" title="7.6. Homogeneous Transformation Matrices and Quaternions — MDAnalysis.core.transformations"
             accesskey="P">previous</a> |</li>
        <li><a href="../../index.html">MDAnalysis v0.7.5-devel documentation</a> &raquo;</li>
          <li><a href="../core_modules.html" accesskey="U">7. Core modules</a> &raquo;</li> 
      </ul>
    </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/mdanalysis-logo-200x150.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">7.7. Fast QCP RMSD structure alignment &#8212; <tt class="docutils literal"><span class="pre">MDAnalysis.core.qcprot</span></tt></a><ul>
<li><a class="reference internal" href="#references">7.7.1. References</a></li>
<li><a class="reference internal" href="#functions">7.7.2. Functions</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="transformations.html"
                        title="previous chapter">7.6. Homogeneous Transformation Matrices and Quaternions &#8212; <tt class="docutils literal docutils literal"><span class="pre">MDAnalysis.core.transformations</span></tt></a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="units.html"
                        title="next chapter">7.8. Constants and unit conversion &#8212; <tt class="docutils literal"><span class="pre">MDAnalysis.core.units</span></tt></a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/documentation_pages/core/qcprot.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <span class="target" id="module-MDAnalysis.core.qcprot"></span><div class="section" id="fast-qcp-rmsd-structure-alignment-mdanalysis-core-qcprot">
<h1>7.7. Fast QCP RMSD structure alignment &#8212; <a class="reference internal" href="#module-MDAnalysis.core.qcprot" title="MDAnalysis.core.qcprot"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.core.qcprot</span></tt></a><a class="headerlink" href="#fast-qcp-rmsd-structure-alignment-mdanalysis-core-qcprot" title="Permalink to this headline">¶</a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Author:</th><td class="field-body">Joshua L. Adelman, University of Pittsburgh</td>
</tr>
<tr class="field"><th class="field-name">Contact:</th><td class="field-body"><a class="reference external" href="mailto:jla65&#37;&#52;&#48;pitt&#46;edu">jla65<span>&#64;</span>pitt<span>&#46;</span>edu</a></td>
</tr>
<tr class="field"><th class="field-name">Year:</th><td class="field-body">2011</td>
</tr>
<tr class="field"><th class="field-name">Licence:</th><td class="field-body">BSD</td>
</tr>
</tbody>
</table>
<p><a class="reference external" href="https://github.com/synapticarbors/pyqcprot">PyQCPROT</a> is a python/cython implementation of Douglas Theobald&#8217;s QCP
method for calculating the minimum RMSD between two structures
<a class="reference internal" href="#theobald2005">[Theobald2005]</a> and determining the optimal least-squares rotation
matrix <a class="reference internal" href="#liu2010">[Liu2010]</a>.</p>
<p>A full description of the method, along with the original C implementation can
be found at <a class="reference external" href="http://theobald.brandeis.edu/qcp/">http://theobald.brandeis.edu/qcp/</a></p>
<div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">The <a class="reference internal" href="#MDAnalysis.core.qcprot.CalcRMSDRotationalMatrix" title="MDAnalysis.core.qcprot.CalcRMSDRotationalMatrix"><tt class="xref py py-func docutils literal"><span class="pre">CalcRMSDRotationalMatrix()</span></tt></a> function is used in
<a class="reference internal" href="../analysis/align.html#module-MDAnalysis.analysis.align" title="MDAnalysis.analysis.align"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.analysis.align</span></tt></a>.</p>
</div>
<div class="section" id="references">
<h2>7.7.1. References<a class="headerlink" href="#references" title="Permalink to this headline">¶</a></h2>
<p>If you use this QCP rotation calculation method in a publication, please reference:</p>
<table class="docutils citation" frame="void" id="theobald2005" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[Theobald2005]</a></td><td>Douglas L. Theobald (2005)
&#8220;Rapid calculation of RMSD using a quaternion-based characteristic polynomial.&#8221;
Acta Crystallographica A 61(4):478-480.</td></tr>
</tbody>
</table>
<table class="docutils citation" frame="void" id="liu2010" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id2">[Liu2010]</a></td><td>Pu Liu, Dmitris K. Agrafiotis, and Douglas L. Theobald (2010)
&#8220;Fast determination of the optimal rotational matrix for macromolecular superpositions.&#8221;
J. Comput. Chem. 31, 1561-1563.</td></tr>
</tbody>
</table>
</div>
<div class="section" id="functions">
<h2>7.7.2. Functions<a class="headerlink" href="#functions" title="Permalink to this headline">¶</a></h2>
<p>Users will typically use the <a class="reference internal" href="#MDAnalysis.core.qcprot.CalcRMSDRotationalMatrix" title="MDAnalysis.core.qcprot.CalcRMSDRotationalMatrix"><tt class="xref py py-func docutils literal"><span class="pre">CalcRMSDRotationalMatrix()</span></tt></a> function.</p>
<dl class="function">
<dt id="MDAnalysis.core.qcprot.CalcRMSDRotationalMatrix">
<tt class="descclassname">MDAnalysis.core.qcprot.</tt><tt class="descname">CalcRMSDRotationalMatrix</tt><big>(</big><big>)</big><a class="headerlink" href="#MDAnalysis.core.qcprot.CalcRMSDRotationalMatrix" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the RMSD &amp; rotational matrix.</p>
<dl class="docutils">
<dt>CalcRMSDRotationalMatrix(ref, conf, N, rot, weights):</dt>
<dd><table class="first last docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Input:</th><td class="field-body"><ul class="first simple">
<li>ref     &#8211; reference structure coordinates (<em>must</em> be <cite>numpy.float64</cite>)</li>
<li>conf    &#8211; candidate structure coordinates (<em>must</em> be <cite>numpy.float64</cite>)</li>
<li>N       &#8211; the size of the system</li>
<li>rot[9]  &#8211; array to store rotation matrix; set to None if only calculating rmsd (modified in place)</li>
<li>weight  &#8211; the weight array of size len; set to None if not needed</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Output:</th><td class="field-body"><ul class="first simple">
<li>rot[9]  &#8211; rotation matrix</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><ul class="first last simple">
<li>RMSD value</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">All arrays <em>must</em> be of type <cite>numpy.float64</cite>.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="MDAnalysis.core.qcprot.InnerProduct">
<tt class="descclassname">MDAnalysis.core.qcprot.</tt><tt class="descname">InnerProduct</tt><big>(</big><big>)</big><a class="headerlink" href="#MDAnalysis.core.qcprot.InnerProduct" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the inner product of two structures.</p>
<p>InnerProduct(A, coords1, coords2, N, weight) &#8211;&gt; (G1+G2)/2</p>
<p>If weight array is not <tt class="xref docutils literal"><span class="pre">None</span></tt>, calculate the weighted inner product.</p>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Input:</th><td class="field-body"><ul class="first simple">
<li>A[9]    &#8211; inner product array (modified in place)</li>
<li>coords1 &#8211; reference structure</li>
<li>coords2 &#8211; candidate structure</li>
<li>N       &#8211; the size of the system</li>
<li>weight  &#8211; the weight array of size N: set to None if not needed</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Output:</th><td class="field-body"><ul class="first simple">
<li>A[9]    &#8211; the inner product matrix</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><ul class="first last simple">
<li>(G1 + G2) * 0.5; used as E0 in function <a class="reference internal" href="#MDAnalysis.core.qcprot.FastCalcRMSDAndRotation" title="MDAnalysis.core.qcprot.FastCalcRMSDAndRotation"><tt class="xref py py-func docutils literal"><span class="pre">FastCalcRMSDAndRotation()</span></tt></a></li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<ol class="last arabic">
<li><p class="first">You MUST center the structures, coords1 and coords2, before calling this function.</p>
</li>
<li><p class="first">Please note how the structure coordinates are stored as 3xN arrays,
not Nx3 arrays as is also commonly used. The difference is
something like this for storage of a structure with 8 atoms:</p>
<div class="highlight-python"><pre>Nx3: xyzxyzxyzxyzxyzxyzxyzxyz
3xN: xxxxxxxxyyyyyyyyzzzzzzzz</pre>
</div>
</li>
</ol>
</div>
</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="MDAnalysis.core.qcprot.FastCalcRMSDAndRotation">
<tt class="descclassname">MDAnalysis.core.qcprot.</tt><tt class="descname">FastCalcRMSDAndRotation</tt><big>(</big><big>)</big><a class="headerlink" href="#MDAnalysis.core.qcprot.FastCalcRMSDAndRotation" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the RMSD, and/or the optimal rotation matrix.</p>
<p>FastCalcRMSDAndRotation(rot, A, E0, N)</p>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Input:</th><td class="field-body"><ul class="first simple">
<li>rot[9]  &#8211; rotation matrix (modified in place)</li>
<li>A[9]    &#8211; the inner product of two structures</li>
<li>E0      &#8211; (G1 + G2) * 0.5</li>
<li>N       &#8211; the size of the system</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Output:</th><td class="field-body"><ul class="first simple">
<li>rot[9]   &#8211; the rotation matrix in the order of xx, xy, xz, yx, yy, yz, zx, zy, zz</li>
<li>rmsd     &#8211; the RMSD value</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><ul class="first last simple">
<li>only the rmsd was calculated if rot is None</li>
<li>both the RMSD &amp; rotational matrix calculated if rot is not None</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div></blockquote>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="units.html" title="7.8. Constants and unit conversion — MDAnalysis.core.units"
             >next</a> |</li>
        <li class="right" >
          <a href="transformations.html" title="7.6. Homogeneous Transformation Matrices and Quaternions — MDAnalysis.core.transformations"
             >previous</a> |</li>
        <li><a href="../../index.html">MDAnalysis v0.7.5-devel documentation</a> &raquo;</li>
          <li><a href="../core_modules.html" >7. Core modules</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2005-2011, Naveen Michaud-Agrawal, Elizabeth J. Denning, Joshua Adelman,
    Christian Beckstein (logo), David Caplan, Jan Domański, Philip Fowler,
    Joseph Goose, Benjamin Hall, Danny Parton, Tyler Reddy, Paul Rigor,
    and Oliver Beckstein.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
  </body>
</html>